<h1>Editing message</h1>

<% form_for(@message) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :message_type %><br />
    <%= f.text_field :mtype %>
  </p>
  <p>
    <%= f.label :message_time %><br />
    <%= f.datetime_select :mtime %>
  </p>
  <p>
    <%= f.label :sender %><br />
    <%= select "message", "sender", User.all.collect {|u| [ u.name, u.id ]} %>
  </p>
  <p>
    <%= f.label :receiver %><br />
    <%= select "message", "receiver", User.all.collect {|u| [ u.name, u.id ]} %>
  </p>
  <p>
    <%= f.label :handled %><br />
    <%= f.check_box :handled %>
  </p>
  <p>
    <%= f.submit 'Update' %>
  </p>
<% end %>

<%= link_to 'Show', @message %> |
<%= link_to 'Back', messages_path %>
